// @Date         2021-11-10
// @Author       Aaron Zhang
// @Description
// @FileName      foo.go

package demo

import (
	"log"
	"zin/framework/cobra"
)

// InitFoo 初始化Foo命令
func InitFoo() *cobra.Command {
	FooCommand.AddCommand(Foo1Command)
	return FooCommand
}

// FooCommand 代表Foo命令
var FooCommand = &cobra.Command{
	Use:     "foo",
	Short:   "foo的简要说明",
	Long:    "foo的长说明",
	Aliases: []string{"fo", "f"},
	Example: "foo命令的例子",
	RunE: func(c *cobra.Command, args []string) error {
		//container := c.GetContainer()
		log.Println("foo~~~")
		//var st []string
		//st[0] = "123" cron内是可以接受到异常， 并打钱
		return nil
	},
}

// Foo1Command 代表Foo命令的子命令Foo1
var Foo1Command = &cobra.Command{
	Use:     "foo1",
	Short:   "foo1的简要说明",
	Long:    "foo1的长说明",
	Aliases: []string{"fo1", "f1"},
	Example: "foo1命令的例子",
	RunE: func(c *cobra.Command, args []string) error {
		log.Println("foo1~~~~~~~")
		return nil
	},
}
